<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorate="~{theme/default/layout}">

<head>
    <meta property="og:title" th:content="${post.title + ' | ' + #servletContext.getAttribute('configMap')['blog_name']}" />
    <title>[[${post.title}]] | [[${#servletContext.getAttribute('configMap')['blog_name']}]]</title>
    <meta name="description" th:content="${post.summary}" />
    <meta property="og:description" th:content="${post.summary}" />
    <link rel="stylesheet" th:href="@{'/admin/assets/custom/jquery-comment/jquery-comment.css'}">
</head>
<body>
    <div layout:fragment="content">
        <!-- 图片 -->
        <div class="image-banner" style="color: #fff">
            <div class="image-content"><img th:data-original="@{${post.coverUrl}}" class="lazyload"></div>
            <div class="descr">
                <a th:href="@{/}">首页  /  </a>
                <a href="javascript:void(0)">文章详情  /  </a>
                <a href="javascript:void(0)">[[${post.title}]]</a>
            </div>
            <div class="title">[[${post.title}]]</div>
        </div>

        <div class="ml-content">
            <div id="postContainer" class="postContainer animated fadeIn">
                <header class="post-header">
                    <div class="blogger-info">
                        <img class="hidden-xs" th:src="@{${#strings.isEmpty(#servletContext.getAttribute('configMap')['logo_url']) != true ? #servletContext.getAttribute('configMap')['logo_url'] : prefix + '/source/images/logo.png'}}">
                        <span class="blog-author"><img th:src="@{${prefix} + '/source/images/detail/detail_bloger.png'}" width="20" height="20">  [[${#servletContext.getAttribute('configMap')['blog_author']}]]</span>
                        <span class="post-date"><img th:src="@{${prefix} + '/source/images/detail/detail_date.png'}" width="20" height="20">  [[${post.year} + ' 年 ' + ${post.month} + ' 月 ' + ${post.day} + ' 日']]</span>
                        <div class="post-nums">
                            <span><img th:src="@{${prefix} + '/source/images/detail/detail_read.png'}" width="20" height="20">  [[${post.readNum}]]</span>&nbsp;&nbsp;
                            <span><img th:src="@{${prefix} + '/source/images/detail/detail_comment.png'}" width="20" height="20">  [[${post.commentNum}]]</span>
                        </div>
                    </div>
                </header>
                <div class="alert alert-danger" th:if="${post.reprint == true}">
                    <ul class="post-copyright">
                        <li>
                            <strong>原作者:</strong> <b>[[${post.author}]]</b>
                        </li>
                        <li>
                            <strong>原文链接:</strong> <a class="alert-link" th:href="@{${post.reprintLink}}" target="_blank" th:text="${post.reprintLink}"></a>
                        </li>
                    </ul>
                </div>
                <div id="post-content" class="post-content" th:utext="${md.md2html(post.id, post.content, 2)}"></div>

                <div id="share" class="shareContainer">
                    <div class="btns">
                        <button type="button" class="btn btn-success" id="priseBtn"><i class="fa fa-thumbs-o-up"></i> <span id="prizeCount">[[${post.praiseNum}]]</span></button>
                        <button type="button" class="btn btn-default" id="shareOpenBtn"><i class="fa fa-share-square-o"></i> 分享</button>
                    </div>
                    <div id="shareBtns" class="social-share" data-initialized="true">
                        <a href="#" class="social-share-icon icon-weibo"></a>
                        <a href="#" class="social-share-icon icon-qq"></a>
                        <a href="#" class="social-share-icon icon-qzone"></a>
                        <a href="#" class="social-share-icon icon-wechat"></a>
                    </div>
                </div>

                <div class="text-center">
                    <span th:if="${#strings.isEmpty(#servletContext.getAttribute('configMap')['we_chat_gzh']) != true}">
                        <a href="javascript:void(0)" class="reward-img">
                            <img th:src="@{${#servletContext.getAttribute('configMap')['we_chat_gzh']}}" width="164" height="164" alt="微信公众号">
                            <div class="reward-desc" th:text="${#servletContext.getAttribute('configMap')['we_chat_gzh_comment']}"></div>
                        </a>
                    </span>
                </div>

                <div class="weChat-official-accounts" th:if="${#strings.isEmpty(#servletContext.getAttribute('configMap')['we_chat_official_account']) != true}">
                    <h4>关注微信公众号</h4>
                    <img class="lazyload" th:data-original="@{${#servletContext.getAttribute('configMap')['we_chat_official_account']}}">
                </div>

                <hr>

                <div id="reward" class="reward text-center">
                    <p><b th:text="${#servletContext.getAttribute('configMap')['reward_comment']}"></b></p>
                    <button id="showRewardImg" type="button" class="btn btn-danger"><i class="fa fa-heartbeat"></i> 打赏</button>
                    <div id="rewardImgArea" class="reward-img-area hide">
                       <span th:if="${#strings.isEmpty(#servletContext.getAttribute('configMap')['reward_by_ali_pay']) != true}">
                            <a href="javascript:void(0)" class="reward-img">
                                <img th:src="@{${#servletContext.getAttribute('configMap')['reward_by_ali_pay']}}" width="164" height="164" alt="支付宝">
                                <div class="reward-desc">支付宝</div>
                            </a>
                       </span>
                        <span th:if="${#strings.isEmpty(#servletContext.getAttribute('configMap')['reward_by_we_chat_pay']) != true}">
                            <a href="javascript:void(0)" class="reward-img">
                                <img th:src="@{${#servletContext.getAttribute('configMap')['reward_by_we_chat_pay']}}" width="164" height="164" alt="微信">
                                <div class="reward-desc">微信</div>
                            </a>
                        </span>
                    </div>
                </div>

                <div id="prizeMsg"></div>
                <div class="alert alert-info" role="alert">
                    <ul class="post-copyright">
                        <li>
                            <strong>本文作者:</strong> <b>[[${#servletContext.getAttribute('configMap')['blog_author']}]]</b>
                        </li>
                        <li>
                            <strong>本文链接:</strong> <a id="shareUrl" class="alert-link" th:href="@{${#servletContext.getAttribute('configMap')['home_page']} + '/'+${post.link}}" target="_blank" th:text="${#servletContext.getAttribute('configMap')['home_page']+'/'+ post.link}"></a>
                        </li>
                        <li>
                            <strong>版权声明:</strong>  本博客所有文章除特别声明外均为原创，采用 <a th:href="@{${#servletContext.getAttribute('configMap')['license_url']}}" class="alert-link" target="_blank" th:text="${#servletContext.getAttribute('configMap')['license']}"></a> 许可协议。转载请在文章开头明显位置注明原文链接和作者等相关信息，明确指出修改（如有），并通过 E-mail 等方式告知，谢谢合作！
                        </li>
                    </ul>
                </div>
                <footer class="post-other-info">
                    <a th:href="${'/' + previousPost.link}" class="prev pull-left" th:if="${#objects.nullSafe(previousPost, null)}">上一篇<span class="hidden-xs">：《[[${previousPost.title}]]》</span></a>
                    <a th:href="${'/' + nextPost.link}" class="next pull-right" th:if="${#objects.nullSafe(nextPost, null)}">下一篇<span class="hidden-xs">：《[[${nextPost.title}]]》</span></a>
                </footer>
                <!-- 目录 -->
                <div class="tocContainer hidden-xs" id="tocContainer"></div>
            </div>
        </div>

        <!-- 评论 -->
        <div id="comment-container" class="comment-container"></div>

        <script th:src="@{${prefix} + '/source/js/jquery.min.js'}"></script>
        <script th:src="@{'/admin/assets/custom/jquery-comment/jquery.cookie.js'}"></script>
        <script th:src="@{'/admin/assets/custom/jquery-comment/jquery-comment.js'}"></script>
        <script th:src="@{${prefix} + '/source/js/detail.js'}"></script>
        <script type="text/javascript" th:inline="javascript">
            $(function () {
                CommentManager.init([[${post.id}]], [[${post.comment}]]);
            });
        </script>
    </div>
</body>
</html>
